<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="refresh" content="5">
    <title>表格演示</title>
</head>

<body>
    <p>表格是用来显示二维数据的重要标签</p>
    <hr>
    <p>构建两行三列的表格</p>
    <!-- table>(tr>td*3)*2  两行三列-->
    <!-- border之类的标签不推荐使用 -->
    <table border="0">
        <tr>
            <td>单元格</td>
            <td>单元格</td>
            <td>单元格</td>
        </tr>
        <tr>
            <td>单元格</td>
            <td>单元格</td>
            <td>单元格</td>
        </tr>
    </table>

    <br>
    <br>
    <br>
    <br>

    <p>构建含有caption/thead/tbody/tfoot标签的表格</p>
    <!-- caption/thead/tbody/tfoot具有语义 -->
    <table border="1">
        <caption>学生信息登记表</caption>
        <thead>
            <tr>
                <td>姓名</td>
                <td>学号</td>
                <td>排名</td>
                <td>分数</td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>张三</td>
                <td>20190101</td>
                <td>1</td>
                <td>680</td>
            </tr>
            <tr>
                <td>李四</td>
                <td>20190102</td>
                <td>2</td>
                <td>670</td>
            </tr>
            <tr>
                <td>王五</td>
                <td>20190103</td>
                <td>3</td>
                <td>660</td>
        </tbody>
        <tfoot>
            <tr>
                <td>统计：</td>
                <td>空白</td>
                <td>空白</td>
                <td>空白</td>
            </tr>
        </tfoot>
    </table>
    <br><br><br><br>
    <p>构建含有caption/thead/tbody/tfoot标签的表格,th标签显示为表格</p>
    <!-- caption/thead/tbody/tfoot具有语义 -->
    <table border="1">
        <caption>学生信息登记表</caption>
        <thead>
            <tr>
                <td>&nbsp;</td>
                <th>姓名</th>
                <th>学号</th>
                <th>排名</th>
                <th>分数</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <th>1</th>
                <td>张三</td>
                <td>20190101</td>
                <td>1</td>
                <td>680</td>
            </tr>
            <tr>
                <th>2</th>
                <td>李四</td>
                <td>20190102</td>
                <td>2</td>
                <td>670</td>
            </tr>
            <tr>
                <th>3</th>
                <td>王五</td>
                <td>20190103</td>
                <td>3</td>
                <td>660</td>
        </tbody>
        <tfoot>
            <tr>
                <!-- <td>统计：</td>
                <td>空白</td>
                <td>空白</td> -->
                <td>统计：</td>
                <td colspan="4">&nbsp;</td>

            </tr>
        </tfoot>
    </table>

    <br><br><br><br>

    <p>表格列分组</p>
    <table border="1">
        <tr>
            <col span="2">
            <col span="3">
            <td>分组1</td>
            <td>分组1</td>
            <td>分组2</td>
            <td>分组2</td>
            <td>分组2</td>
        </tr>
        <tr>
            <td>分组1</td>
            <td>分组1</td>
            <td>分组2</td>
            <td>分组2</td>
            <td>分组2</td>
        </tr>
        <tr>
            <td>分组1</td>
            <td>分组1</td>
            <td>分组2</td>
            <td>分组2</td>
            <td>分组2</td>
        </tr>
    </table>
</body>

</html>